from django.contrib.auth.models import User, Group
from rest_framework import serializers
from qa.models import qaWatch, qClass


class qClassSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = qClass
        fields = ('id', 'q_class')


class userSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = User
        fields = ('id', 'username')


class qaWatchSerializer(serializers.HyperlinkedModelSerializer):
    q_class = qClassSerializer()

    class Meta:
        model = qaWatch
        fields = ('id', 'q_user', 'q_content', 'q_level', 'q_status', 'q_timer', 'a_user', 'a_timer', 'q_backUp', 'q_class', 'q_checkOut')